import { Component, OnInit,Output,Input,EventEmitter } from '@angular/core';
const httpOptions = { headers: new HttpHeaders({ 'Content-Type': 'application/json' }) };
import { HttpClient, HttpParams, HttpHeaders } from '@angular/common/http';
import { Router } from '@angular/router';
import { NzModalRef, NzFormatEmitEvent, NzModalService, NzTreeComponent, NzTreeNodeOptions, NzMessageService } from 'ng-zorro-antd';
import { PagesService } from '../../services/pages.service';
import { UtilService } from '../../services/util.service';
import { RequestService } from '../../services/request.service';
declare var layui: any;
declare var layer: any;
declare var $: any;

@Component({
  selector: 'app-unread',
  templateUrl: './unread.component.html',
  styleUrls: ['./unread.component.scss']
})
export class UnreadComponent implements OnInit {

  constructor(public router: Router, private http: HttpClient, public interfaceService: PagesService, public utilService: UtilService,public request:RequestService) {
    
  }

  ngOnInit() {
    this.unreadInfo();
  }

  @Output()  private  outer=new EventEmitter();
  unreadInfo(){
    /**
     * 获取未读通知数量
     */
    this.request.getUnread().subscribe((data)=>{
      console.log('未读数量-->'+data.object)
      this.outer.emit(data.object)
    });
  }

}
